package Task35;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = scanner.nextInt();
            System.out.println(fibonacci(n));
        }
    }
    public static long fibonacci(int n){
        long f1 = 1;
        long f2 = 1;
        long f3 = 2;
        if( n < 2){
            return 1;
        } else if (n == 2) {
            return 2;
        }
        int i = 2;
        while (i < n){
            f1 = f2;
            f2 = f3;
            f3 = f1+ f2;
            i++;
        }
        return f3;
    }
}
